var id=getvl("id");
var  consultantid="";


 $(function(){
  	if(id!=''){
  		   goodsIdList();
  		 
  	}else{
  		alert("参数有误");
  	}
  	
  });
function goodsIdList(){
	  $("#pingjiashijan").html("");
	 $("#guwenziliao").html("");
	$.ajax({
		url: urlcore + "/api/consultant/shopinfoconsultant?userId="+id,
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
				var da=data.data;
				 consultantid=da.consultant.id;
				   var guwenziliao='<dl>'+
'			<dt>'+
'				<img src="'+da.consultant.headImg+'" />'+
'			</dt>'+
'			<dd>'+
'				<h5>'+da.consultant.userName+'</h5>'+
'				<p>电话：'+da.consultant.phone+'</p>'+
'				<p>微信：'+da.consultant.wxCount+'</p>'+
'			</dd>'+
'		</dl>';
/*'		<a href="#">私聊</a>'*/
 var myDate = new Date();
    var yuefen=myDate.getMonth()+1;
       $("#guwenziliao").append(guwenziliao);
    $("#pingjiashijan").append("请您对顾问<span>"+da.consultant.userName+"</span>"+yuefen+"月份的表现给予评价");
                

			} 
		},
		error:function() {
			/* Act on the event */
			alert("error");
		}
	});	

}




function  addids(){
	    var shangjiafuwu=$("#shangjiafuwu").val();
	    var wuliufuwu=$("#wuliufuwu").val();
	    var ganxiang=$("#ganxiang").val();
		 $.ajax({
		url: urlcore + "/api/consultantComment/add2",
		type: "post",
		contentType: "application/json;charset=utf-8",
		data: JSON.stringify({
		"userId":id,	
     "consultantId":consultantid,
    "abilityPoint":shangjiafuwu,
    "attitudePoint":wuliufuwu,
     "comment":ganxiang
		}),
		dataType: "json",
		success: function(data) {
			if(data.success == true) {
				alert("评价成功...");
		      window.location.href = document.referrer;
		     }
		},error: function() {
			alert("error");
		}
	});
}
